114cd8507f6bcc26d4b56bd53c88cd17ee31afbf,src/test/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcAddTest.java,IptcAddTest,testAddIptcData,#,62

Before Change


        OutputStream os = null;
        boolean canThrow = false;
        try {
            os = new FileOutputStream(updated);
            os = new BufferedOutputStream(os);
            new JpegIptcRewriter().writeIPTC(byteSource, os, newData);
            canThrow = true;
        } finally {
            IoUtils.closeQuietly(canThrow, os);

After Change


        final File updated = createTempFile(imageFile.getName() + ".iptc.add.", ".jpg");
        try (FileOutputStream fos = new FileOutputStream(updated);
                OutputStream os = new BufferedOutputStream(fos)) {
            new JpegIptcRewriter().writeIPTC(byteSource, os, newData);
        }

        final ByteSource updateByteSource = new ByteSourceFile(updated);